import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

import BlankLayout from '@/layouts/BlankLayout.vue';
import SecurityLayout from '@/layouts/SecurityLayout.vue';
import QiankunLayout from '@/layouts/QiankunLayout/index.vue';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/homepage',
    component: BlankLayout,
    children: [
      {
        path: '/homepage',
        name: 'homepage',
        component: SecurityLayout,
        children: [
          {
            path: '',
            component: QiankunLayout,
          },
        ],
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(process.env.MICRO_PUBLIC_PATH),
  routes,
});

export default router;
